from peewee import *

database = MySQLDatabase('porsches', **{'charset': 'utf8', 'sql_mode': 'PIPES_AS_CONCAT', 'use_unicode': True, 'host': '192.168.10.193', 'port': 3306, 'user': 'a', 'password': '110'})

class UnknownField(object):
    def __init__(self, *_, **__): pass

class BaseModel(Model):
    class Meta:
        database = database

class CarsPartNumNew(BaseModel):
    brand_code = CharField(column_name='brandCode', null=True)
    cid = CharField(null=True)
    condition = CharField(null=True)
    createtime = DateTimeField()
    extra_info = TextField(null=True)
    img = CharField(null=True)
    isreplace = CharField(null=True)
    itid = CharField(null=True)
    label = CharField(null=True)
    logo = CharField(null=True)
    maingroup = CharField(constraints=[SQL("DEFAULT ''")])
    mid = CharField(constraints=[SQL("DEFAULT ''")])
    model = CharField(null=True)
    num = CharField(constraints=[SQL("DEFAULT ''")])
    pid = CharField(index=True, null=True)
    pnum = CharField(null=True)
    price = CharField(null=True)
    psort = IntegerField(null=True)
    quantity = CharField(null=True)
    refmid = CharField(null=True)
    remark = CharField(null=True)
    replacelabel = CharField(null=True)
    rid = CharField(null=True)
    sa_code = CharField(null=True)
    status = IntegerField(constraints=[SQL("DEFAULT 1")])
    subgroup = CharField(constraints=[SQL("DEFAULT ''")])
    updatetime = DateTimeField(constraints=[SQL("DEFAULT CURRENT_TIMESTAMP")])

    class Meta:
        table_name = 'cars_part_num_new'
        indexes = (
            (('cid', 'mid', 'brand_code'), False),
            (('cid', 'pid', 'mid', 'itid', 'pnum', 'psort'), False),
        )

class CarsStructureCollectionNew(BaseModel):
    brand_code = CharField(column_name='brandCode', null=True)
    cid = CharField(constraints=[SQL("DEFAULT ''")])
    condition = CharField(null=True)
    createtime = DateTimeField()
    description = CharField(null=True)
    extra_info = TextField()
    image_large = CharField(column_name='imageLarge', null=True)
    img_name = CharField(column_name='imgName', null=True)
    img_points = TextField(column_name='imgPoints', null=True)
    logo = CharField(null=True)
    maingroup = CharField(constraints=[SQL("DEFAULT ''")])
    mid = CharField(constraints=[SQL("DEFAULT ''")])
    model = CharField(null=True)
    name = CharField(null=True)
    num = CharField(constraints=[SQL("DEFAULT ''")])
    sa_code = CharField(null=True)
    status = IntegerField(constraints=[SQL("DEFAULT 1")])
    subgroup = CharField(constraints=[SQL("DEFAULT ''")])
    uid = CharField(null=True, unique=True)
    updatetime = DateTimeField(constraints=[SQL("DEFAULT CURRENT_TIMESTAMP")])

    class Meta:
        table_name = 'cars_structure_collection_new'
        indexes = (
            (('cid', 'mid', 'brand_code', 'status'), False),
            (('cid', 'num', 'brand_code', 'status'), False),
        )

class CarsSaDesc(BaseModel):
    brand_code = CharField(column_name='brandCode', constraints=[SQL("DEFAULT ''")])
    createtime = DateTimeField()
    desc = CharField(constraints=[SQL("DEFAULT ''")])
    lang = CharField(null=True)
    sa = CharField()
    sa_family = CharField()

    class Meta:
        table_name = 'cars_sa_desc'
        indexes = (
            (('sa', 'sa_family', 'brand_code', 'lang'), True),
        )
        primary_key = False
